<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'image-ads-form',
    'enableClientValidation' => true,
    'htmlOptions' => array(
	'enctype' => 'multipart/form-data'
    )
	))
?>

<?php echo $form->errorSummary($model) ?>



<div>

    <label>Link</label> <br/>

    <?php echo $form->textField($model, 'url') ?>

    <?php echo $form->error($model, 'url') ?>

</div>



<div>

    <label>Image</label> <br/>

    <?php
    if ($model->image != '')
	echo '<img src="' . UPLOAD_URL . $model->image . '" alt="image"/><br><br>';
    ?>
    <?php echo CHtml::activeFileField($model, 'photo') ?>

    <?php echo $form->error($model, 'image') ?>

    <?php echo $form->hiddenField($model, 'image') ?>

</div>
<br>


<div>

    <label>Select location</label><br/>

    <?php
    echo $form->dropDownList($model, 'position', array(
	'right' => 'Right sidebar',
	'left' => 'Left sidebar',
	'bottom' => 'Bottom',
	'home_right' => 'Home - right sidebar'
    ))
    ?>

</div> <br/>





<br/>



<div >

    <label>Status</label>

    <?php
    echo $form->dropDownList($model, 'status', array(
	1 => 'Active',
	0 => 'Disable'
    ))
    ?>

</div>

<br/>



<div>

    <input type="submit" value="Submit" />

</div>



<?php $this->endWidget() ?>